<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>登&nbsp;陆</title>
    <link rel="stylesheet" type="text/css" href="css/reset.css"/>
    <link rel="stylesheet" type="text/css" href="css/all.css"/>
    <script src="js/jquery-1.7.1.min.js"></script>
    <script src="js/self.js"></script>
</head>
<body ontouchstart="">

<div class="container db jz h100 pr">
    <section class="w100 h100">
        <section class="loginBlock w100 db">
            <div>
                <input type="tel" name="tel" value="" placeholder="手机号" required="required" id="loginTel"/>
            </div>
            <div>
                <input type="password" name="pwd" value="" placeholder="密码" required="required" id="password"/>
            </div>
            <div style="border: none">
                <button type="button" id="loginBub" class="f18 cf tc w100">登&nbsp;陆</button>
            </div>
        </section>
        <p class="loginBottom w100 tc">
            <a href="fastRegist.html" class="c9 f14">快速注册</a><span></span><a href="forgotPassward.html" class="c9 f13">忘记密码</a>
        </p>
        <section class="pa w100" style="bottom: 10%;z-index: 20;color: #ff6666;">
            <div class="w100 f11 tc ffa">
                <p>版本 : v 20160608.12.1</p>
                <p>&copy;2016 桂林市达安商贸有限公司</p>
            </div>
        </section>
    </section>

</div>
<div class="theme-popover-mask">
    <div class="w100 h100 of">
        <img src="images/loading.gif" class="jz hauto db" style="margin-top: 66%;width: 32px"/>
    </div>
</div>
<script>
    $(function () {
        $('#loginBub').click(function () {
            var tel = $.trim($('#loginTel').val());
            var password = $.trim($('#password').val());
            var pattern = /^1[0-9]{10}$/;

            if (tel == "") {
                alert("你还未填写手机号");
                return false;
            }
            if (!pattern.test(tel)) {
                alert("请输入正确的手机号码!");
                isPhone = 0;
                return false;
            }
            if (password == "") {
                alert("请输入密码!");
                return false;
            }

            $.ajax({
                url: "LoginServlet",
                data: JSON.stringify({m: 60, mobile: tel, password: $.md5(password), platform: 0}),
                type: 'post',
                dataType: 'json',
                beforeSend: function () {
                    $('.theme-popover-mask').show();
                },
                success: function (data) {
                    if (data.state == 1) {
                        // 登录成功 跳转到主页
                        window.location.href='mb/jsp/index.jsp';
                    } else {
                        alert(data.info);
                    }
                },
                error: function (data) {
                    alert(data.info);
                },
                complete: function () {
                    $('.theme-popover-mask').hide();
                }
            });
        })

    })

</script>

</body>
</html>